#include <iostream>
#include <vector>
#include <fmt/core.h>
#include <fmt/ranges.h>
#include <fmt/chrono.h>
using namespace std::literals::chrono_literals;
#include <fmt/os.h>

auto main(int argc, const char *argv[]) -> int {
    // <fmt/core.h>
    fmt::print("Hello, world!\n");
    std::cout << fmt::format("满分是{}。", 100) << std::endl;
    std::cout << fmt::format("I'd rather be {1} than {0}.", "right", "happy") << std::endl;

    // <fmt/ranges.h>
    std::vector<int> v = {1, 2, 3};
    fmt::print("{}\n", v);

    // <fmt/chrono.h>
    fmt::print("Default format: {} {}\n", 42s, 100ms);
    fmt::print("strftime-like format: {:%H:%M:%S}\n", 3h + 15min + 30s);

    // <fmt/os.h>
    auto out = fmt::output_file("guide.txt");
    out.print("Don't {}", "Panic");

    return 0;
}